home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: Offscreen drawing
- Sent: 4/8/96 7:19 PM
- Received: 4/8/96 7:31 PM
- From: Mark Lanett, mlanett@meer.net
- Reply-To: ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- At 0:26 PM 4/8/96, Lars Travers wrote:
- >Can some please point me to some ODF sample code that shows how to
- >create and use an offscreen buffer?
-
- void CFrame::Draw (Environment* ev, ODFacet* odFacet, ODShape* invalidShape)
- {
- FW_CRect bounds (FW_kZeroPoint, GetSize(ev));
- FW_CPoint size = bounds.Size();
- FW_CBitmap bitmap (size.IntX(), size.IntY(), 0); // 0 -> best pixel
- depth
- {
- FW_CBitmapContext bc (ev, bitmap);
- FW_CRectShape::RenderRect (bc, bounds, FW_kFill,
- FW_kWhiteEraseInk);
- // do drawing here
- }
-
- // draw the bitmap
- FW_CViewContext vc (ev, this);
- FW_CBitmapShape::RenderBitmap (vc, bitmap, bounds);
- }
-
- This allocates/draws/frees the bitmap on every pass through the draw
- method. You could easily make the bitmap be an instance of your view class
- or something similary (even, with a little care, fork a thread to draw in
- it for a period of time).
-
- markl
-
- --
- Mark Lanett, ODF
-
-
-